/**
 * eCommerce Application Sample for J2EE Training
 * Implementation of EcomCustomerBean
 * @author Fabienne Boyer - Didier Donsez
 * may 2006
 */
package ecom.session;

import ecom.cart.CartLocal;
import ecom.dao.AccountDAO;
import ecom.entity.Account;
import ecom.entity.Adress;
import ecom.entity.Customer;
import javax.ejb.Remote;
import javax.ejb.Stateless;

@Stateless
@Remote(EcomCustomerRemote.class)
public class EcomCustomerBean extends EcomGenericBean implements EcomCustomerRemote {

    @Override
    public void deposit(String iban, Double amount) {

        AccountDAO accountDAO = new AccountDAO();
        Account a = accountDAO.findByIban(iban);
        a.setBalance(a.getBalance() + amount);
        accountDAO.update(a);
        accountDAO.closeSession();

    }

}
